layui.use(['jquery', 'form', 'common', 'croppers'], function() {
	var $ = layui.jquery;
	var form = layui.form;
	var common = layui.common;

	form.on('submit(form)', function(data) {
		$.post('doModifyPassword', data.field, function(data) {
			if (data.state == 'ok') {
				// 成功，跳转到首页
				layer.msg(data.msg, {
					icon: 6,
					time: 2000
				}, function() {
					common.toUrl(common.ctxPath + "/");
				});
			} else {
				// 失败，弹出提示
				layer.msg(data.msg, {
					icon: 5,
					anim: 6
				});
			}
		});
		return false;
	});
});